package com.hmy.finance.api.bo.core.request.enums;


import lombok.Getter;

@Getter
public enum ReceiptOffsetBillStatusEnum {

    DRAFT(10, "草稿", "草稿"),

    CANCEL(11, "已作废", "已作废"),

    REVOKE(12, "已撤销", "已撤销"),

    OFFSET_DELETED(13, "已删除", "已删除"),

    APPROVE_PASS(24, "审批通过,核销中", "审批通过,核销中"),

    AREA_MANAGER_APPROVE_ING(21, "审批中", "销售经理提交, 区域经理审批中"),

    CASHIER_APPROVE_ING(22, "审批中", "出纳会计审批中"),

    ARACCOUNTANT_APPROVE_ING(23, "审批中", "应收会计审批中"),

    APPROVE_REJECTED(25, "审批拒绝", "审批拒绝"),

//    OFFSET_ING(30, "核销中", "核销中"),

    OFFSET_SUCCESS(31, "核销成功", "核销成功"),

    OFFSET_FAILED(32, "核销失败", "核销失败");

    /**
     * 状态code
     */
    private Integer statusCode;

    /**
     * 前端显示状态
     */
    private String displayDesc;

    /**
     * 状态描述
     */
    private String statusDesc;

    ReceiptOffsetBillStatusEnum(Integer statusCode, String displayDesc, String statusDesc) {
        this.statusCode = statusCode;
        this.displayDesc = displayDesc;
        this.statusDesc = statusDesc;
    }

    public static String getDisPlayDescByType(Integer type) {
        for (ReceiptOffsetBillStatusEnum receiptOffsetBillStatusEnum : ReceiptOffsetBillStatusEnum.values()) {
            if (receiptOffsetBillStatusEnum.getStatusCode().intValue() == type) {
                return receiptOffsetBillStatusEnum.getDisplayDesc();
            }
        }
        return null;
    }

    public static ReceiptOffsetBillStatusEnum getEnumByType(Integer type) {
        for (ReceiptOffsetBillStatusEnum receiptOffsetBillStatusEnum : ReceiptOffsetBillStatusEnum.values()) {
            if (receiptOffsetBillStatusEnum.getStatusCode().intValue() == type) {
                return receiptOffsetBillStatusEnum;
            }
        }
        return null;
    }

}
